/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package supermarketv0_class;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ΠΑΝΑΓΙΩΤΗΣ v1
 */
@Entity
@Table(name = "CHECKS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Checks.findAll", query = "SELECT c FROM Checks c"),
    @NamedQuery(name = "Checks.findByCheckId", query = "SELECT c FROM Checks c WHERE c.checkId = :checkId"),
    @NamedQuery(name = "Checks.findByDatetime", query = "SELECT c FROM Checks c WHERE c.datetime = :datetime"),
    @NamedQuery(name = "Checks.findByValidity", query = "SELECT c FROM Checks c WHERE c.validity = :validity"),
    @NamedQuery(name = "Checks.findByAmount", query = "SELECT c FROM Checks c WHERE c.amount = :amount"),
    @NamedQuery(name = "Checks.findByCustomerid", query = "SELECT c FROM Checks c WHERE c.customerid = :customerid")})
public class Checks implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CHECK_ID")
    private Integer checkId;
    @Column(name = "DATETIME")
    @Temporal(TemporalType.DATE)
    private Date datetime;
    @Column(name = "VALIDITY")
    private String validity;
    @Column(name = "AMOUNT")
    private Integer amount;
    @Column(name = "CUSTOMERID")
    private Integer customerid;

    public Checks() {
    }

    public Checks(Integer checkId) {
        this.checkId = checkId;
    }

    public Integer getCheckId() {
        return checkId;
    }

    public void setCheckId(Integer checkId) {
        this.checkId = checkId;
    }

    public Date getDatetime() {
        return datetime;
    }

    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }

    public String getValidity() {
        return validity;
    }

    public void setValidity(String validity) {
        this.validity = validity;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getCustomerid() {
        return customerid;
    }

    public void setCustomerid(Integer customerid) {
        this.customerid = customerid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (checkId != null ? checkId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Checks)) {
            return false;
        }
        Checks other = (Checks) object;
        if ((this.checkId == null && other.checkId != null) || (this.checkId != null && !this.checkId.equals(other.checkId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "supermarketv0_class.Checks[ checkId=" + checkId + " ]";
    }
    
}
